Android: fix 9 build annotation warnings (Linker.xml stale entries + IL2075) - #316
Merged
Merged
Conversation
Agent-Logs-Url: https://github.com/winnerspiros/osu/sessions/bfc25f05-93a4-41df-b509-00e60ffe6d52 Co-authored-by: winnerspiros <1675249+winnerspiros@users.noreply.github.com>
Copilot created this pull request from a session on behalf of
winnerspiros
May 8, 2026 20:49
View session
There was a problem hiding this comment.
Pull request overview
This PR reduces Android Release build noise by removing stale/unresolvable Linker.xml entries and adding targeted suppressions for false-positive trim-analysis warnings (IL2075) around intentional reflection usage.
Changes:
- Remove
Linker.xml<assembly>entries that cannot be resolved (stale/unused assemblies) and document the omissions inline. - Suppress IL2075 warnings in two reflection loops in
OboeAudioRedirectorand one reflective call site inOsuGameAndroid.Dispose().
Reviewed changes
Copilot reviewed 3 out of 3 changed files in this pull request and generated 1 comment.
| File | Description |
|---|---|
| osu.Android/OsuGameAndroid.cs | Adds a targeted IL2075 suppression around a reflective GetMethod() used during disposal. |
| osu.Android/OboeAudioRedirector.cs | Adds targeted IL2075 suppressions around base-type-walking reflection lookups. |
| osu.Android/Linker.xml | Removes stale/unresolvable assembly entries and replaces them with explanatory comments. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Comment on lines
2753
to
+2757
| if (activeMixersList != null && activeMixersHandler != null) | ||
| { | ||
| try | ||
| { | ||
| #pragma warning disable IL2075 // activeMixersList is typed as object — runtime type is known to be an INotifyCollectionChanged-derived BindableList, preserved by Linker.xml |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
The last Android APK build emitted 5 "Could not resolve assembly" linker warnings and 4 IL2075 trim-analysis warnings across
OboeAudioRedirector.csandOsuGameAndroid.cs.Linker.xml — remove 5 unresolvable assembly entries
ppy.osu.Framework/ppy.osu.Framework.Android.NET AndroidFull-link mode cannot locatenet10.0NuGet assemblies during the android-TFM trimmer pass. Entries had zero effect; assemblies are preserved intact because ILLink can't trim what it can't find.Realms.PlatformHelpersRealmassembly in v11+. Realm 20.x doesn't ship it separately.Microsoft.Extensions.Configuration.Abstractionsis in the build closure; base package is not.Microsoft.Extensions.HttpEach removed entry now has an inline comment explaining the omission.
IL2075 suppressions
The Roslyn trimming analyzer warns when
GetMethodis called on aTypeobtained viaGetType()orBaseType(neither carries[DynamicallyAccessedMembers]). The targets are preserved viaosu.Android preserve="all"in Linker.xml, so the warnings are false positives. Suppressed with targeted#pragma warning disable IL2075:OboeAudioRedirector.cs—enqueueOnAudioThreadandtriggerMixerRecreation(BaseType-walking reflection loops)OsuGameAndroid.cs—Dispose(activeMixersList.GetType().GetMethod(...))